package com.example.boot;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.client.RestTemplate;

/**
 * 启动类
 *
 * @author ding
 * @since 2024/7/1
 */
//开启定时任务 Spring框架自带定时任务
@EnableScheduling
@MapperScan("com.example.mapper")  //为mapper层统一添加@Mapper注释
@EnableTransactionManagement
//在SpringBootApplication中添加 exclude = SecurityAutoConfiguration.class 即可取消使用security
@SpringBootApplication(scanBasePackages = {"com.example.service", "com.example.boot.controller", "com.example.mapper", "com.example"})
public class SmartEngineApplication {

    @Bean
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }

    public static void main(String[] args) {
        SpringApplication.run(SmartEngineApplication.class, args);
    }

}
